#include "stdafx.h"
#include "JSObj_WebsiteInfo.h"

CJSObj_WebsiteInfo::CJSObj_WebsiteInfo(IWebBrowser2* pWeb)
	: CScriptObject(pWeb)
{
}

CJSObj_WebsiteInfo::CJSObj_WebsiteInfo(IWebBrowser2* pWeb, IDispatch* pDisp) 
	: CScriptObject(pWeb, pDisp)
{
	GetAll();
}

void CJSObj_WebsiteInfo::GetAll()
{
	GetValue(CComBSTR(L"id"), &m_bstrWebsiteID);
	GetValue(CComBSTR(L"name"), &m_bstrWebsiteName);
	GetValue(CComBSTR(L"url"), &m_bstrUrl);

	GetValue(CComBSTR(L"userName"), &m_bstrUserName);
	GetValue(CComBSTR(L"passWord"), &m_bstrPassWord);

	GetValue(CComBSTR(L"checked"), &m_vbChecked);
	GetValue(CComBSTR(L"needPost"), &m_vbNeedPost);
	GetValue(CComBSTR(L"postUrl"), &m_bstrPostUrl);

	GetValue(CComBSTR(L"needIdentifyingCode"), &m_vbNeedIdentifyingCode);
	GetValue(CComBSTR(L"localIDCPic"), &m_bstrLocalIDCPic);
	GetValue(CComBSTR(L"idcInput"), &m_bstrIDCInput);
}

void CJSObj_WebsiteInfo::SetAll()
{
	SetValue(CComBSTR(L"id"), _variant_t(m_bstrWebsiteID));
	SetValue(CComBSTR(L"name"), _variant_t(m_bstrWebsiteName));
	SetValue(CComBSTR(L"url"), _variant_t(m_bstrUrl));
	
	SetValue(CComBSTR(L"userName"), _variant_t(m_bstrUserName));
	SetValue(CComBSTR(L"passWord"), _variant_t(m_bstrPassWord));
	
	SetValue(CComBSTR(L"checked"), _variant_t(m_vbChecked));
	SetValue(CComBSTR(L"needPost"), _variant_t(m_vbNeedPost));
	SetValue(CComBSTR(L"postUrl"), _variant_t(m_bstrPostUrl));
	
	SetValue(CComBSTR(L"needIdentifyingCode"), _variant_t(m_vbNeedIdentifyingCode));
	SetValue(CComBSTR(L"localIDCPic"), _variant_t(m_bstrLocalIDCPic));
	SetValue(CComBSTR(L"idcInput"), _variant_t(m_bstrIDCInput));
}
